import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//首页
const index = r => require.ensure([], () => r(require('@/pages/Index/Index')), 'index');
//登录
const login = r => require.ensure([], () => r(require('@/pages/Login/Login')), 'login');
//分类
const category = r => require.ensure([], () => r(require('@/pages/Category/Category')), 'category');
//购物车
const shopCar = r => require.ensure([], () => r(require('@/pages/ShopCar/ShopCar')), 'shopCar');
//我的（个人中心）
const personalCenter = r => require.ensure([], () => r(require('@/pages/PersonalCenter/PersonalCenter')), 'personalCenter');
//城市选择
const citys = r => require.ensure([], () => r(require('@/pages/Citys/Citys')), 'citys');


//路由表
const routers = [
  {
    path: '/',
    name: 'root',
    component : index
  }, {
    path: '/index',
		name:'index',
		component: index,
		meta: ['首页'],
  }, {
    path: '/login',
		name:'login',
		component: login,
		meta: ['登录'],
  }, {
    path: '/category',
		name:'category',
		component: category,
		meta: ['分类'],
  }, {
    path: '/shopCar',
		name:'shopCar',
		component: shopCar,
		meta: ['购物车'],
  }, {
    path: '/personalCenter',
		name:'personalCenter',
		component: personalCenter,
		meta: ['我的'],
  },
]

export default new Router({
  routes: routers
})
